/*
 * =====================================================================================
 *
 *       Filename:  fork.c
 *
 *    Description: this file include the sys_fork 
 *
 *        Version:  1.0
 *        Created:  2011年03月15日 17时54分45秒
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  lonelydragon1988@gmail.com 
 *        Company:  
 *
 * =====================================================================================
 */


#include <errno.h>

#include <sched.h>
#include <segment.h>
#include <system.h>


extern void write_verify(unsigned long address);  //this was defined in the memory.c

long last_pid=0;


void verify_area(void *addr,int size)
{
	start=(unsigned long)addr;
	size+=start&0xfff;
	start&=0xfffff000;   //进程空间的逻辑地址

	start+=get_base(current->ldt[2]);
	while(size>0)
	{
		size-=4096;
		write_verify(start);
		start+=4096;
	}
}
